package com.music.controller;

import com.music.service.BaiduFaceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/face")
public class BaiduFaceController {
    @Autowired
    private BaiduFaceService baiduFaceService;

    @PostMapping("/register")
    public boolean register(String imgBase64,String userPhone){
        if(imgBase64 == null || "".equals(imgBase64.trim()))
            return false;
//        music_face
        return  baiduFaceService.faceSign(userPhone, "test", userPhone,imgBase64);
    }
    @PostMapping("/login")
    public boolean login(String imgBase64){
        if(imgBase64 == null || "".equals(imgBase64.trim()))
            return false;
        return baiduFaceService.faceSearch("test",imgBase64);
    }
}
